package homework;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Test1 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("text.txt");
        FileOutputStream fos = new FileOutputStream("text_cp.txt",true);

        byte[] data = new byte[1024*10];
        int d ;// 记录每次实际读取到的字节量
        while ( (d = fis.read(data)) != -1){
            fos.write(data,0,d);
        }
        System.out.println("复制完毕！");
        fos.close();
        fis.close();
    }
}
